package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Employee;
import cn.wolfcode.crm.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Employee record);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    int updateByPrimaryKey(Employee record);

    Employee selectByUsernameAndPassword(@Param("username") String username, @Param("password") String password);

    //添加查询总数的方法
   // int selectForCount(QueryObject qo);
    List<Employee> selectForList(QueryObject qo);

    //添加方法中间表
    void insertRelation(@Param("eid") Long eid, @Param("rid") Long rid);


    void deleteRelation(Long id);

    void deleteBatch(Long[] ids);

    Employee selectByName(String name);

    //这里是用可变参数,这样就可以不用重新new一个数组
    List<Employee> selectByRoleSn(String...sns);

}